package com.wudl.flink.app.func;

import com.alibaba.ververica.cdc.debezium.DebeziumDeserializationSchema;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.util.Collector;
import org.apache.kafka.connect.source.SourceRecord;

/**
 * @ClassName : MyDeserializerFunc
 * @Description :
 * @Author :wudl
 * @Date: 2021-10-07 22:50
 */

public class MyDeserializerFunc implements DebeziumDeserializationSchema<String> {
    @Override
    public void deserialize(SourceRecord sourceRecord, Collector<String> collector) throws Exception {

        String topic = sourceRecord.topic();
        String[] fields = topic.split("\\.");
        String db = fields[1];
        String tableName = fields[2];


    }

    @Override
    public TypeInformation<String> getProducedType() {
        return null;
    }
}
